Accusoft.PdfXpress7.ActiveX
Compress a Document

PDF Xpress™ supports compressing existing documents.

The following is an example in which a PDF document is opened and then saved to disk. Compression is enabled by specifying it in the SaveOptions properties. PDF Xpress attempts to compress the document, if possible. Options for compression are controlled by the CompressOptions properties.

VB6
Copy Code
Option Explicit
Dim pdf As New PdfXpress
Private Sub Command1_Click()
    pdf.Initialize
   
    Dim doc As New PdfDocument
    doc.SetParentControl pdf
    doc.OpenDocument "document.pdf", ""
   
    Dim saveOptions As New SaveOptions
    saveOptions.Compress = True
    saveOptions.Linearized = True
    saveOptions.Overwrite = True
    saveOptions.FileName = "compressed.pdf"
   
    Dim compressOptions As New CompressOptions
   
    doc.SaveDocumentEx saveOptions, compressOptions
    pdf.Terminate
End Sub

 

 


©2017. Accusoft Corporation. All Rights Reserved.

Send Feedback